package book;

import java.util.Arrays;

public class BookList{
    Book[] books = new Book[10];
    int bookNum;
    public BookList() {
        bookNum = 4;
        books[0] = new Book("西游记","小说",20,"吴承恩");
        books[1] = new Book("红楼梦","小说",20,"曹雪芹");
        books[2] = new Book("三国演义","小说",20,"罗贯中");
        books[3] = new Book("水浒传","小说",20,"施耐庵");
    }

    public int getBooknum() {
        return bookNum;
    }

    public void setBooknum(int booknum) {
        this.bookNum = booknum;
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBooks(int n,Book book) {
        books[n] = book;
    }
    public void DelBook(int n) {
        books[n] = null;
    }

    @Override
    public String toString() {
        return "BookList{" +
                "books=" + Arrays.toString(books) +
                '}';
    }
}
